@odc-section-title-line-height: 20px;
@odc-section-title-margin-bottom: 16px;
@odc-base-font-size: 12px;
@import '~xterm/css/xterm.css';
@import (reference) './style/theme/white.less';
@import (reference) './style/theme/dark.less';
// @import './style/theme/antd.dark.less';
/* @import '~antd/dist/antd.less'; */

@font-face {
  font-family: 'RareWord';
  src: url('../public/rareWordsFont.ttf');
}

html,
body,
#root,
#root-slave {
  min-width: 960px;
  height: 100%;
  overflow: auto;
  overflow-y: hidden;
  font-family: Chinese Quote, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, PingFang SC,
    Hiragino Sans GB, Microsoft YaHei, RareWord, Helvetica Neue, Helvetica, Arial, sans-serif,
    monospace;
}
#root-slave {
  position: relative;
  height: calc(100vh - 50px);
  font-size: 12px;
}

.ant-input-group-wrapper {
  .ant-input-affix-wrapper {
    .ant-input {
      height: 20px;
    }
  }
}

#root {
  position: relative;
  font-size: 12px;
}

/* stylelint-disable no-duplicate-selectors */
::after,
::before {
  .odc-white-theme();
}
body {
  .odc-white-theme();

  color: var(--text-color-secondary);
  background-color: var(--background-normal-color);
  .ant-layout {
    min-height: 100%;
  }
}

.odc-dark ::before,
.odc-dark ::after {
  .odc-dark-theme();
}

.odc-dark {
  .odc-dark-theme();

  color: var(--text-color-secondary);
  background-color: var(--background-normal-color);
  .ant-layout-content {
    color: var(--text-color-secondary);
  }

  ::-webkit-scrollbar {
    background-color: #1c1d1f;
  }

  ::-webkit-scrollbar-thumb {
    background-color: #363a3d;
  }

  ::-webkit-scrollbar-corner {
    background-color: #2d2f32;
  }

  .ant-layout {
    min-height: 100%;
  }
}

.colorWeak {
  filter: invert(80%);
}

canvas {
  display: block;
}

body {
  width: 100vw;
  overflow-x: auto;
  overflow-y: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.globalSpin {
  width: 100%;
  margin: 40px 0 !important;
}

ul,
ol {
  list-style: none;
}

.Resizer {
  z-index: 1;
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  // background: #000;
  -moz-background-clip: padding;
  -webkit-background-clip: padding;
  background-clip: padding-box;
  opacity: 0.2;
}

.Resizer:hover {
  -webkit-transition: all 2s ease;
  transition: all 2s ease;
}

.Resizer.horizontal {
  z-index: 20;
  width: 100%;

  /* height: 11px; */
  height: 0;
  margin: -5px 0;
  border-top: 5px solid rgba(255, 255, 255, 0);
  border-bottom: 5px solid rgba(255, 255, 255, 0);
  cursor: row-resize;
}

.Resizer.horizontal:hover {
  border-top: 5px solid @odc-border-color-dark;
  border-bottom: 5px solid @odc-border-color-dark;
}

.Resizer.vertical {
  z-index: 20;

  /* width: 11px; */
  width: 0;
  margin: 0 -5px;
  border-right: 5px solid transparent;

  /* border-left: 5px solid rgba(255, 255, 255, 0); */

  /* border-right: 5px solid rgba(255, 255, 255, 0); */
  border-left: 5px solid transparent;
  cursor: col-resize;
}

.Resizer.vertical:hover {
  border-right: 5px solid @odc-border-color-dark;
  border-left: 5px solid @odc-border-color-dark;
}

.Resizer.disabled {
  cursor: not-allowed;
}

.Resizer.disabled:hover {
  border-color: transparent;
}

.ant-page-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 999;
  color: #fff;
  font-family: MicrosoftYaHei;
  background: #3f3f3f;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.1);
}
.ant-menu-vertical {
  .ant-menu-item {
    width: 100%;
  }
}
.ant-page-header-title-view-title {
  color: #fff;
  font-size: 16px;
}

.ant-page-header-back-button {
  color: #fff;
}

// antd tree 箭头颜色替换
.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-switcher .ant-tree-switcher-icon {
  color: var(--text-color-primary);
}

/* 可编辑表格内输入组件去掉圆角 */
.rdg-editor-container {
  z-index: 1002 !important;

  .ant-input,
  .ant-input-number,
  .ant-select-selection {
    border-radius: initial !important;
  }
}

/* 单元格可选择 */

/* @see https://github.com/adazzle/react-data-grid/issues/1430#issuecomment-449516910 */
.react-grid-Cell {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* 灰色小行文字 */
.o-small-tip {
  color: var(--text-color-placeholder);
  font-family: PingFangSC-Regular;
}

.o-table-search {
  width: 160px;
  font-size: 12px;

  .ant-input {
    font-size: 12px;
  }
}

.o-tableHeader {
  display: inline-block;
  margin-bottom: @odc-section-title-margin-bottom;
  overflow: hidden;
  color: var(--text-color-hint);
  font-size: @odc-base-font-size;
  line-height: @odc-section-title-line-height;
  white-space: nowrap;
  text-align: right;
  vertical-align: middle;
}

.o-mini-table {
  .o-min-table-odd {
    background: var(--background-tertraiy-color);
  }

  &:not(.o-mini-table--no-border) {
    .ant-table {
      border: 1px solid var(--odc-border-color);
      border-bottom: none;
    }
  }
  .ant-table-filter-column {
    .ant-table-column-title {
      color: var(--text-color-primary);
    }
  }
  .ant-table-thead {
    .ant-table-cell {
      .anticon {
        color: var(--icon-color-normal);
      }
      .active .anticon,
      .anticon.active {
        color: var(--icon-color-focus);
      }
    }
  }
  .ant-pagination-next[aria-disabled='false'] {
    .anticon {
      color: var(--icon-color-normal);
    }
  }
  .ant-pagination-disabled {
    .anticon {
      color: var(--neutral-grey5-color);
    }
  }

  .ant-table {
    font-size: 12px;
  }

  .ant-table-thead > tr > th {
    white-space: nowrap;
  }

  .ant-table-thead > tr > th,
  .ant-table-tbody > tr > td {
    height: 24px;
    padding: 0 8px;
  }

  .ant-table-column-title {
    color: var(--text-color-secondary);
  }

  .ant-table-column-has-sorters {
    position: relative;
  }

  .ant-table-column-sorter {
    position: absolute;
    top: 4px;
    right: 6px;
  }
}

.o-middle-table {
  .o-middle-table-odd {
    background: #f0f2f5;
  }

  &:not(.o-middle-table--no-border) {
    .ant-table {
      border: 1px solid #e8e8e8;
      border-bottom: none;
    }
  }

  .ant-table {
    font-size: 12px;
  }

  .ant-table-thead > tr > th {
    height: 32px;
    padding: 0 8px;
    white-space: nowrap;
  }

  .ant-table-tbody > tr > td {
    height: 32px;
    padding: 8px 8px;
  }

  .ant-table-column-title {
    color: @odc-text-color-secondary-dark;
  }

  .ant-table-column-has-sorters {
    position: relative;
  }

  .ant-table-column-sorter {
    position: absolute;
    top: 4px;
    right: 6px;
  }
}

.o-table--no-lr-border {
  .ant-table-bordered.ant-table-empty .ant-table-placeholder {
    border-right: none;
    border-left: none;
  }

  .ant-table-bordered .ant-table-thead > tr th:last-of-type,
  .ant-table-bordered .ant-table-tbody > tr td:last-of-type {
    border-right: none;
  }

  .ant-table-bordered .ant-table-header > table,
  .ant-table-bordered .ant-table-body > table,
  .ant-table-bordered .ant-table-fixed-left table,
  .ant-table-bordered .ant-table-fixed-right table {
    border-left: none;
  }
}

// tabs antd4 兼容 antd3
.ant-tabs .ant-tabs-content > .ant-tabs-tabpane {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: -1;
  display: block !important;
  opacity: 0;

  &.ant-tabs-tabpane-active {
    position: relative;
    z-index: unset;
    opacity: unset;
  }
}

// pl-debug
.editor-breakpoints {
  top: 6px;
  left: 10px !important;
  width: 8px !important;
  height: 8px !important;
  background: #ff4d4f;
  border-radius: 4px;
}

.editor-breakpoints-fake {
  top: 6px;
  left: 10px !important;
  width: 8px !important;
  height: 8px !important;
  background: #ff4d4f;
  border-radius: 4px;
  opacity: 0.2;
}

.editor-highlight-line {
  background: var(--code-background-highlight-color);
}
.editor-selection-stmt-info {
  background: var(--code-background-hover-color);
}
.editor-selection-stmt-error {
  background: var(--code-background-error-color);
}

@keyframes lineShine {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.editor-shine-line {
  background-color: var(--code-background-selected-color);
  animation-name: lineShine;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-iteration-count: 2;
  animation-direction: alternate;
}

// drawer
.o-adaptive-drawer {
  &.ant-drawer {
    .ant-drawer-content-wrapper {
      min-width: 580px;
      max-width: 100vw;
    }
  }
}

/*
* 公有云主应用内 ODC 样式适配
*/
#odc-container {
  position: absolute;
  width: 100%;
  height: 100vh;
}

// tab 左右布局的样式，例如表详情
.odc-left-tabs {
  height: 100%;
  > .ant-tabs-nav {
    background-color: var(--background-secondry-color);
    border-right: 1px solid var(--divider-color);
    > .ant-tabs-nav-wrap {
      > .ant-tabs-nav-list {
        > .ant-tabs-tab {
          padding-right: 17px;
          padding-left: 17px;
          &.ant-tabs-tab-active {
            background: var(--hover-color);
          }
          & + .ant-tabs-tab {
            margin-top: 0;
          }
        }
        .ant-tabs-ink-bar.ant-tabs-ink-bar-animated {
          left: 0;
        }
      }
    }
  }
  .ant-tabs-content-holder {
    > .ant-tabs-content {
      height: 100%;
      > .ant-tabs-tabpane {
        height: 100%;
        padding-left: 0px !important;
        overflow-x: hidden;
        overflow-y: auto;
      }
    }
  }
}

@keyframes odcDarkMask {
  from {
    background: rgba(28, 29, 31, 0.8);
  }
  to {
    background: rgba(0, 0, 0, 0);
  }
}

@keyframes odcWhiteMask {
  from {
    background: rgba(0, 0, 0, 0.5);
  }
  to {
    background: rgba(255, 255, 255, 0);
  }
}
